package com.cw.realtime.common
package util

import org.wltea.analyzer.core.IKSegmenter

import java.io.StringReader
import scala.collection.mutable

object IkUtil {

  def ikSplit(s: String): Seq[String] = {
    val seg = new IKSegmenter(new StringReader(s), true)
    val lb = mutable.ListBuffer.empty[String]
    var next = seg.next()
    while (next != null) {
      lb += next.getLexemeText
      next = seg.next()
    }
    lb.toVector
  }
}
